<script setup lang="ts">
import { ref } from "vue";
import { IMFormProps } from "../utils/types";
import FileImport from "@/components/common/FileImport";
import { getIMPtemplate } from "@/utils/common";

const props = withDefaults(defineProps<IMFormProps>(), {
  formInline: () => ({
    fileList: []
  })
});

const ruleFormRef = ref();
const newFormInline = ref(props.formInline);

function getRef() {
  return ruleFormRef.value;
}
defineExpose({ getRef });
</script>

<template>
  <div class="px-5">
    <el-form ref="ruleFormRef" :model="newFormInline">
      <el-row>
        <el-col :span="24">
          <el-form-item
            label=""
            prop="fileList"
            :rules="[{ required: true, message: '导入文件不能为空' }]"
          >
            <FileImport
              v-model="newFormInline.fileList"
              :dowURL="getIMPtemplate('importDeposTem')"
              style="width: 100%"
            />
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>

<style lang="scss" scoped></style>
